<?php
	class home extends My_Controller
	{
		function home()
		{
			parent::__construct();
		}
		
		function index($city="")
		{
			if ($city=="")
			{
				$data['title']		= 'Trang chủ';
				$this->load->view('sites/home', $data);
			}
			else
			{
				$province_id		= "";
				$province_name		= "";
				$province			= $this->mod_lib->load_all('provinces', '', array('status'=>1), '', '', array('hot'=>'DESC', 'name'=>'ASC'));
				foreach ($province as $prov)
				{
					if ($city	== url_title(utf8_to_ascii($prov['name'])))
					{
						$province_id	= $prov['id'];
						$province_name	= url_title(utf8_to_ascii($prov['name']));
					}					
				}
				$data['title']			= 'Trang chủ';
				$data['province_id']	= $province_id;
				$data['province_name']	= $province_name;
				$this->load->view('sites/home', $data);
			}			
		}
	}